<template>
<div style="padding-left:10px;padding-right:10px;">
  <div class="div">
    <span style="font-weight:bold">会员卡特权</span>
  </div>
  <div v-for="(item,index) in datas" :key="index">
    <div class="div">
      <div style="font-size:16px;">{{item.title}}</div>
    </div>
  </div>
</div>
</template>

<script>
import api from '@/utils/api'
import {
  mapState,
  mapActions,
  mapGetters
} from 'vuex'
export default {
  data() {
    return {
      datas: '',
    }
  },
  computed: {
    ...mapGetters([

      'user'
    ])
  },
  beforeMount() {
    console.log('beforeMount')
    if (!this.user || !this.user.id) {
      // 用户未授权
      let url = 'get_user_info?callback_url=description'
      wx.redirectTo({
        url: url
      })
      return
    }
  },
  async mounted() {
    // let result = await api.getMemberDay({brand_id:this.login_info.brand_id})
    let result = await api.findCardPrerogatives({
      brand_id: this.user.brand_id,
      card_tpl_id: this.user.card_tpl_id,
      page: 0,
      limit: 9999
    })
    console.log(result)
    if (result.code == 0) {
      this.datas = result.data.data
    }
  },
  methods: {

  }
}
</script>

<style >
.div {
  padding-top: 10px;
}
</style>
